const Mock = require('mockjs');
const util = require('./util');

module.exports = function (app) {
  //获取用户信息
  app.get('/authority/sysUser/info', function (rep, res) {
    var json = util.getJsonFile('./api/userInfo.json');
    res.json(Mock.mock(json));
  });
  //登录
  app.post('/login', function (rep, res) {
    var json = util.getJsonFile('./api/login.json');
    res.json(Mock.mock(json));
  });
  //退出登录
  app.post('/logout', function (rep, res) {
    var json = util.getJsonFile('./api/logout.json');
    res.json(Mock.mock(json));
  });
  //动态路由
  app.get('/permission', function (rep, res) {
    var json = util.getJsonFile('./api/permission.json');
    res.json(Mock.mock(json));
  });
  //用户列表
  app.get('/users/list', function (rep, res) {
    var json = util.getJsonFile('./api/userlist.json');
    res.json(Mock.mock(json));
  });
  //用户列表
  app.get('/report/index', function (rep, res) {
    var json = util.getJsonFile('./api/homeChart.json');
    res.json(Mock.mock(json));
  });
}
